winsafe\mf\com_interfaces/
imftopologynode.rs1#![allow(non_camel_case_types, non_snake_case)]
2
3use crate::co;
4use crate::decl::*;
5use crate::macros::*;
6use crate::mf::vts::*;
7use crate::ole::privs::*;
8use crate::prelude::*;
9
10com_interface! { IMFTopologyNode: "83cf873a-f6da-4bc8-823f-bacfd55dc430";
11 }
30
31impl mf_IMFAttributes for IMFTopologyNode {}
32impl mf_IMFTopologyNode for IMFTopologyNode {}
33
34pub trait mf_IMFTopologyNode: mf_IMFAttributes {
43 fn CloneFrom(&self, node: &impl mf_IMFTopologyNode) -> HrResult<()> {
46 HrRet(unsafe { (vt::<IMFTopologyNodeVT>(self).CloneFrom)(self.ptr(), node.ptr()) })
47 .to_hrresult()
48 }
49
50 fn ConnectOutput(
53 &self,
54 output_index: u32,
55 downstream_node: &impl mf_IMFTopologyNode,
56 input_index_on_downstream_node: u32,
57 ) -> HrResult<()> {
58 HrRet(unsafe {
59 (vt::<IMFTopologyNodeVT>(self).ConnectOutput)(
60 self.ptr(),
61 output_index,
62 downstream_node.ptr(),
63 input_index_on_downstream_node,
64 )
65 })
66 .to_hrresult()
67 }
68
69 #[must_use]
72 fn DisconnectOutput(&self, output_index: u32) -> HrResult<()> {
73 HrRet(unsafe { (vt::<IMFTopologyNodeVT>(self).DisconnectOutput)(self.ptr(), output_index) })
74 .to_hrresult()
75 }
76
77 #[must_use]
83 fn GetInput(&self, input_index: u32) -> HrResult<(IMFTopologyNode, u32)> {
84 let mut queried = unsafe { IMFTopologyNode::null() };
85 let mut output_index_downstream_node = 0u32;
86 HrRet(unsafe {
87 (vt::<IMFTopologyNodeVT>(self).GetInput)(
88 self.ptr(),
89 input_index,
90 queried.as_mut(),
91 &mut output_index_downstream_node,
92 )
93 })
94 .to_hrresult()
95 .map(|_| (queried, output_index_downstream_node))
96 }
97
98 #[must_use]
101 fn GetInputCount(&self) -> HrResult<u32> {
102 let mut c = 0u32;
103 HrRet(unsafe { (vt::<IMFTopologyNodeVT>(self).GetInputCount)(self.ptr(), &mut c) })
104 .to_hrresult()
105 .map(|_| c)
106 }
107
108 #[must_use]
111 fn GetNodeType(&self) -> HrResult<co::MF_TOPOLOGY> {
112 let mut ty = co::MF_TOPOLOGY::default();
113 HrRet(unsafe { (vt::<IMFTopologyNodeVT>(self).GetNodeType)(self.ptr(), ty.as_mut()) })
114 .to_hrresult()
115 .map(|_| ty)
116 }
117
118 #[must_use]
121 fn GetObject<T>(&self) -> HrResult<T>
122 where
123 T: ole_IUnknown,
124 {
125 let mut queried = unsafe { T::null() };
126 HrRet(unsafe { (vt::<IMFTopologyNodeVT>(self).GetObject)(self.ptr(), queried.as_mut()) })
127 .to_hrresult()
128 .map(|_| queried)
129 }
130
131 #[must_use]
137 fn GetOutput(&self, output_index: u32) -> HrResult<(IMFTopologyNode, u32)> {
138 let mut queried = unsafe { IMFTopologyNode::null() };
139 let mut input_index_downstream_node = 0u32;
140 HrRet(unsafe {
141 (vt::<IMFTopologyNodeVT>(self).GetOutput)(
142 self.ptr(),
143 output_index,
144 queried.as_mut(),
145 &mut input_index_downstream_node,
146 )
147 })
148 .to_hrresult()
149 .map(|_| (queried, input_index_downstream_node))
150 }
151
152 #[must_use]
155 fn GetOutputCount(&self) -> HrResult<u32> {
156 let mut c = 0u32;
157 HrRet(unsafe { (vt::<IMFTopologyNodeVT>(self).GetOutputCount)(self.ptr(), &mut c) })
158 .to_hrresult()
159 .map(|_| c)
160 }
161
162 #[must_use]
165 fn GetTopoNodeID(&self) -> HrResult<u64> {
166 let mut id = 0u64;
167 HrRet(unsafe { (vt::<IMFTopologyNodeVT>(self).GetTopoNodeID)(self.ptr(), &mut id) })
168 .to_hrresult()
169 .map(|_| id)
170 }
171
172 fn SetObject(&self, object: &impl ole_IUnknown) -> HrResult<()> {
175 HrRet(unsafe { (vt::<IMFTopologyNodeVT>(self).SetObject)(self.ptr(), object.ptr()) })
176 .to_hrresult()
177 }
178
179 fn SetTopoNodeID(&self, topo_id: u64) -> HrResult<()> {
182 HrRet(unsafe { (vt::<IMFTopologyNodeVT>(self).SetTopoNodeID)(self.ptr(), topo_id) })
183 .to_hrresult()
184 }
185}